package driver;

import java.util.ArrayList;

import vo.ChooseCourseVO;
import vo.StudentVO;
import vo.TeacherVO;
import vo.UserVO;
import businesslogicservice.ResultMessage;
import businesslogicservice.UserBLService;

public class UserBLService_Driver {
	
	public void drive(UserBLService userBLService){
		ResultMessage resultMessage=userBLService.register(12345678, "abc123", "abc123");
		if (resultMessage==ResultMessage.REGISTER_SUCCESS) {
			System.out.println("Register success!");
		}
		ResultMessage resultMessage2=userBLService.login(12345678, "abc123");
		if (resultMessage2==ResultMessage.LOGIN_SUCCESS) {
			System.out.println("Login success!");
		}
		ResultMessage resultMessage3=userBLService.changePassword("abc123", "zxzx", "zxzx");
		if (resultMessage3==ResultMessage.CHANGE_SUCCESS) {
			System.out.println("Change password success");
		}
		ResultMessage resultMessage4=userBLService.addUser(new UserVO());
		if (resultMessage4==ResultMessage.ADD_USER_SUCCESS) {
			System.out.println("Add user success");
		}
		ResultMessage resultMessage5=userBLService.deleteUser(new UserVO());
		if (resultMessage5==ResultMessage.DELETE_USER_SUCCESS) {
			System.out.println("Delete user success");
		}
		UserVO userVO=userBLService.modifyUser(new UserVO());
		if (userVO!=null) {
			System.out.println("Modify user success!");
		}
		
		UserVO userVO2=userBLService.getUser(00001);
		if (userVO2!=null) {
			System.out.println("Get user success!");
		}
		
		ArrayList<TeacherVO> teacherVOList=userBLService.getTeacherList(03);
		if (teacherVOList!=null) {
			System.out.println("Get teacherlist success!");
		}
		
		ArrayList<StudentVO> studentVOList=userBLService.getStudentList(04);
		if (studentVOList!=null) {
			System.out.println("Get studentlist success!");
		}
		
		TeacherVO teacherVO=userBLService.getTeacherInfo(0001);
		if (teacherVO!=null) {
			System.out.println("Get teacherinfo success!");
		}
		
		StudentVO studentVO=userBLService.getStudentInfo(0001);
		if (studentVO!=null) {
			System.out.println("Get studentinfo success!");
		}
		
		double gpa=userBLService.getGPA(new ChooseCourseVO());
		if (gpa==4.5) {
			System.out.println("Get GPA success!");
		}
		
	}

}
